/*************************************************************************
 *                    free                     *
 *************************************************************************
 *************************************************************************
 * Filename	   : package_process.h
 * Description   : This file is used to TODO
 * Version	   : 1.0
 * History       :
 free 2013-4-17  Create
 *************************************************************************/

#ifndef _PACKAGE_PROCESS_H_
#define _PACKAGE_PROCESS_H_

typedef struct
{
	unsigned int sync_byte :8;
	unsigned int transport_error_indicator :1;
	unsigned int payload_unit_start_indicator :1;
	unsigned int transport_priority :1;
	unsigned int PID :13;
	unsigned int transport_scrambling_control :2;
	unsigned int adaptation_field_control :2;
	unsigned int continuity_counter :4;
} PACKAGE_HEADER;

void GetPackageHeader(PACKAGE_HEADER *stPackageHeader, unsigned char *pucBuffer);
int CopyToFileByPID(FILE *pInputFile, char *pOutputFileName, int iPackageLength, long int liFirstPackageOffset, int iPackagePID);
int CopyToFileByPmt(FILE *pInputFile, char *pOutputFileName, int iPackageLength, long int liFirstPackageOffset, SECTION_PMT *pstTablePmt);

#endif /* PACKAGE_PROCESS_H_ */
